﻿#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDateEdit>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //
    spinbox=new QSpinBox(this);
    spinbox->setGeometry(QRect(50,50,100,25));
    spinbox->setRange(0,200);
    spinbox->setValue(10);
    QString a=QString::fromLocal8Bit("元");
    spinbox->setSuffix(a);
    spinbox->setPrefix("$");
    //
    timeEdit=new QTimeEdit(this);
    timeEdit->setGeometry(QRect(50,100,120,25));
    QDateTime sysTime=QDateTime::currentDateTime();
    QStringList list=sysTime.toString("hh:mm:ss").split(':');
    timeEdit->setTime(QTime(list[0].toInt(),list[1].toInt(),list[2].toInt()));
    //
    dateEdit=new QDateEdit(this);
    dateEdit->setGeometry(QRect(50,150,120,25));
    QStringList dateListStr=sysTime.toString("yyyy-MM-dd").split('-');
    dateEdit->setDate(QDate(dateListStr[0].toInt(),dateListStr[1].toInt(),dateListStr[2].toInt()));

}

MainWindow::~MainWindow()
{
    delete ui;
}
